package com.hhkj.study.api.user.common.handler;

import com.hhkj.captcha.common.handler.CaptchaHandler;
import com.hhkj.captcha.model.extend.Captcha;
import com.hhkj.sms.common.template.AliDaYuTemplate;
import com.hhkj.sms.model.CaptchaTemplateParam;
import com.hhkj.sms.model.base.BaseSendParam;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 验证码登录
 * @Author luowu
 * @Date 2024/6/28 涵 14:12:39
 */
@Component
public class AccountCaptchaWxHandler implements CaptchaHandler {

    @Resource
    private AliDaYuTemplate template;

    @Override
    public String getCode() {
        return "wxSource";
    }

    @Override
    public void beforeSend(String mobile) {

    }

    @Override
    public BaseSendParam createCaptchaSmsBody(Captcha captcha) {
        return template.createSmsBody(new CaptchaTemplateParam(captcha.getCaptcha()));
    }
}
